package basic;

import java.util.Scanner;
public class text_arr {
    public static void main(String[] args) {
        int[] arr=new int[]{1,2,3,4,5,};
        for (int element:arr) {
            System.out.println(element);
        }
        try {
            System.out.println(arr[5]);
        }
        catch (ArrayIndexOutOfBoundsException indexout) {
            System.out.println("数组越界");
        }
        Scanner input=new Scanner(System.in);
        int array[][]=new int[2][4];
        for (int i = 0; i < array.length; i++) {
            for (int j = 0; j < array[i].length; j++) {
                array[i][j]=input.nextInt();
            }
        }
    }
}
